package org.lanqiao.service;

import java.util.List;
import java.util.UUID;

import org.lanqiao.dao.OrderDaoImpl;
import org.lanqiao.pojo.OrderListPOJO;
import org.lanqiao.pojo.PageModel;

public class OrderServiceImpl {
	OrderDaoImpl  order=new OrderDaoImpl();
	/**
	 * 调用添加订单方法
	 * @param n
	 * @return
	 */
	public List addOrder(OrderListPOJO n,List list) {
//		购物车商品更新
		UUID uuid=UUID.randomUUID();
	    String str = uuid.toString();
		order.orders(n,str);
		System.out.println("数组："+list.toString());
		order.updateOrder(str,list);
		return order.queryOrder(str);
	}
	/**
	 * 未付款订单
	 * @return
	 */
	public List Unpaid(){
		List a = null;
		return a;
	}
	/**
	 * 订单查询分页
	 */
	 public PageModel<List> pagingOrders(String userId,String page,String pageSize){
		PageModel model=order.listOrder(userId,page, pageSize);
		return model;
	}
	/**
	 * 订单查询
	 */
	public List orderQuery(String id) {
		return order.queryOrder(id);
	}
	/**
	 * 修改订单
	 */
	public List amendOrders(String price,String id,String userId) {
		order.amendOrder(price,id);
		return order.Unpaid(userId);
		
	}
	/**
	 * 删除订单
	 */
	public PageModel<List> deleteOrders(String id,String userId,String page,String number) {
		order.deleteOrders(id);
		return order.listOrder(userId,page,number);
	}
	/**
	 * 取消订单
	 */
	public int cancellationOrders(String id) {
		return order.cancellationOrder(id);
	}
	/**
	 * 未付款订单查询
	 */
	public List<OrderListPOJO> Unpaids(String id) {
		return order.Unpaid(id);
	}
	
	/**
	 * 未发货订单查询
	 */
	public List alreadyPaids(String id) {
		return order.alreadyPaid(id);
	}
	/**
	 * 未收货订单查询
	 */
	public List goodsReceived(String id) {
		return order.goodsReceived(id);
	}
	/**
	 * 已收货订单查询
	 */
	public List receivedGoods(String id) {
		return order.receivedGoods(id);
	}
	/**
	 * 订单详情
	 */
	public List orderDetails(String id) {
		return order.orderDetails(id);
	}
	/**
	 * 订单结算
	 */
	public int orderSettlement(String id) {
		return order.orderSettlement(id);
	}
	
}
